package cn.jinjie.day04.test03;

public class Test01 {
    public static void main(String[] args) {
        StringTest st = new StringTest();
        //匿名内部类
        useStringHandler(new StringHandler() {
            @Override
            public void processString(String s) {
                // st.testStr(s);
                System.out.println(s);
            }
        });
        //lambda
        // useStringHandler(s -> st.testStr(s));
        useStringHandler(s ->  System.out.println(s));
        //方法引用
        // useStringHandler(st::testStr);
        useStringHandler(System.out::println);



    }

    public static void useStringHandler(StringHandler s) {
        s.processString("abcddw");
    }
}
